<?php
namespace app\mxty\model;

use think\Model;
use think\model\concern\SoftDelete;

class TimeTemplate extends Model
{
  use SoftDelete;
  protected $deleteTime = 'delete_time';
  protected $table = 'athlon_time_template';
  protected $pk = 'time_template_id';

  public function fragments()
  {
    return $this->hasMany(TimeFragment::class);
  }

  public function arenas()
  {
    return $this->hasMany(Arena::class);
  }

  public function parts()
  {
    return $this->hasManyThrough(ArenaPart::class, Arena::class);
  }

}